package kr.hkit.powerjava.chapter22.collection;

import java.util.Vector;

public class VectorTest {
	public static void main(String[] args) {
		Vector vc = new Vector();
		vc.add("Hello java");
		vc.add(new Integer(20));
		vc.add(10);
		
		
		
		System.out.println("Vector에 들어가있는 자료개수 = "+ vc.size());
		
		for (int i = 0; i < vc.size(); i++) {
			System.out.print(vc.get(i)+ "\t");
		}
		System.out.println();
		String str = (String) vc.get(0);		//get()은 object타입으로 반환하므로 형변환하여서 사용한다.
		System.out.println(str);
		
		Vector<String> strVector = new Vector<>();
		strVector.add("H");
		strVector.add("e");
		strVector.add("l");
		
		for (int i = 0; i < strVector.size(); i++) {
			System.out.printf("%s ", strVector.get(i));
		}
	}
	
}
